Integrand size = 19, antiderivative size = 253 \[ \int \frac {\sin ^2(x)}{a+b \sin (x)+c \sin ^2(x)} \, dx=\frac {x}{c}-\frac {\sqrt {2} \left (b-\frac {b^2-2 a c}{\sqrt {b^2-4 a c}}\right ) \arctan \left (\frac {2 c+\left (b-\sqrt {b^2-4 a c}\right ) \tan \left (\frac {x}{2}\right )}{\sqrt {2} \sqrt {b^2-2 c (a+c)-b \sqrt {b^2-4 a c}}}\right )}{c \sqrt {b^2-2 c (a+c)-b \sqrt {b^2-4 a c}}}-\frac {\sqrt {2} \left (b+\frac {b^2-2 a c}{\sqrt {b^2-4 a c}}\right ) \arctan \left (\frac {2 c+\left (b+\sqrt {b^2-4 a c}\right ) \tan \left (\frac {x}{2}\right )}{\sqrt {2} \sqrt {b^2-2 c (a+c)+b \sqrt {b^2-4 a c}}}\right )}{c \sqrt {b^2-2 c (a+c)+b \sqrt {b^2-4 a c}}} \]
x/c-arctan(1/2*(2*c+(b-(-4*a*c+b^2)^(1/2))*tan(1/2*x))*2^(1/2)/(b^2-2*c*(a +c)-b*(-4*a*c+b^2)^(1/2))^(1/2))*2^(1/2)*(b+(2*a*c-b^2)/(-4*a*c+b^2)^(1/2) )/c/(b^2-2*c*(a+c)-b*(-4*a*c+b^2)^(1/2))^(1/2)-arctan(1/2*(2*c+(b+(-4*a*c+ b^2)^(1/2))*tan(1/2*x))*2^(1/2)/(b^2-2*c*(a+c)+b*(-4*a*c+b^2)^(1/2))^(1/2) )*2^(1/2)*(b+(-2*a*c+b^2)/(-4*a*c+b^2)^(1/2))/c/(b^2-2*c*(a+c)+b*(-4*a*c+b ^2)^(1/2))^(1/2)
Result contains complex when optimal does not.
Time = 1.36 (sec) , antiderivative size = 310, normalized size of antiderivative = 1.23 \[ \int \frac {\sin ^2(x)}{a+b \sin (x)+c \sin ^2(x)} \, dx=\frac {x-\frac {\left (i b^2-2 i a c+b \sqrt {-b^2+4 a c}\right ) \arctan \left (\frac {2 c+\left (b-i \sqrt {-b^2+4 a c}\right ) \tan \left (\frac {x}{2}\right )}{\sqrt {2} \sqrt {b^2-2 c (a+c)-i b \sqrt {-b^2+4 a c}}}\right )}{\sqrt {-\frac {b^2}{2}+2 a c} \sqrt {b^2-2 c (a+c)-i b \sqrt {-b^2+4 a c}}}-\frac {\left (-i b^2+2 i a c+b \sqrt {-b^2+4 a c}\right ) \arctan \left (\frac {2 c+\left (b+i \sqrt {-b^2+4 a c}\right ) \tan \left (\frac {x}{2}\right )}{\sqrt {2} \sqrt {b^2-2 c (a+c)+i b \sqrt {-b^2+4 a c}}}\right )}{\sqrt {-\frac {b^2}{2}+2 a c} \sqrt {b^2-2 c (a+c)+i b \sqrt {-b^2+4 a c}}}}{c} \]
(x - ((I*b^2 - (2*I)*a*c + b*Sqrt[-b^2 + 4*a*c])*ArcTan[(2*c + (b - I*Sqrt [-b^2 + 4*a*c])*Tan[x/2])/(Sqrt[2]*Sqrt[b^2 - 2*c*(a + c) - I*b*Sqrt[-b^2 + 4*a*c]])])/(Sqrt[-1/2*b^2 + 2*a*c]*Sqrt[b^2 - 2*c*(a + c) - I*b*Sqrt[-b^ 2 + 4*a*c]]) - (((-I)*b^2 + (2*I)*a*c + b*Sqrt[-b^2 + 4*a*c])*ArcTan[(2*c + (b + I*Sqrt[-b^2 + 4*a*c])*Tan[x/2])/(Sqrt[2]*Sqrt[b^2 - 2*c*(a + c) + I *b*Sqrt[-b^2 + 4*a*c]])])/(Sqrt[-1/2*b^2 + 2*a*c]*Sqrt[b^2 - 2*c*(a + c) + I*b*Sqrt[-b^2 + 4*a*c]]))/c
Time = 1.02 (sec) , antiderivative size = 253, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.158, Rules used = {3042, 3737, 2009}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \frac {\sin ^2(x)}{a+b \sin (x)+c \sin ^2(x)} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\sin (x)^2}{a+b \sin (x)+c \sin (x)^2}dx\) |
\(\Big \downarrow \) 3737 |
\(\displaystyle \int \left (\frac {-a-b \sin (x)}{c \left (a+b \sin (x)+c \sin ^2(x)\right )}+\frac {1}{c}\right )dx\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle -\frac {\sqrt {2} \left (b-\frac {b^2-2 a c}{\sqrt {b^2-4 a c}}\right ) \arctan \left (\frac {\tan \left (\frac {x}{2}\right ) \left (b-\sqrt {b^2-4 a c}\right )+2 c}{\sqrt {2} \sqrt {-b \sqrt {b^2-4 a c}-2 c (a+c)+b^2}}\right )}{c \sqrt {-b \sqrt {b^2-4 a c}-2 c (a+c)+b^2}}-\frac {\sqrt {2} \left (\frac {b^2-2 a c}{\sqrt {b^2-4 a c}}+b\right ) \arctan \left (\frac {\tan \left (\frac {x}{2}\right ) \left (\sqrt {b^2-4 a c}+b\right )+2 c}{\sqrt {2} \sqrt {b \sqrt {b^2-4 a c}-2 c (a+c)+b^2}}\right )}{c \sqrt {b \sqrt {b^2-4 a c}-2 c (a+c)+b^2}}+\frac {x}{c}\) |
x/c - (Sqrt[2]*(b - (b^2 - 2*a*c)/Sqrt[b^2 - 4*a*c])*ArcTan[(2*c + (b - Sq rt[b^2 - 4*a*c])*Tan[x/2])/(Sqrt[2]*Sqrt[b^2 - 2*c*(a + c) - b*Sqrt[b^2 - 4*a*c]])])/(c*Sqrt[b^2 - 2*c*(a + c) - b*Sqrt[b^2 - 4*a*c]]) - (Sqrt[2]*(b + (b^2 - 2*a*c)/Sqrt[b^2 - 4*a*c])*ArcTan[(2*c + (b + Sqrt[b^2 - 4*a*c])* Tan[x/2])/(Sqrt[2]*Sqrt[b^2 - 2*c*(a + c) + b*Sqrt[b^2 - 4*a*c]])])/(c*Sqr t[b^2 - 2*c*(a + c) + b*Sqrt[b^2 - 4*a*c]])
3.1.3.3.1 Defintions of rubi rules used
Int[sin[(d_.) + (e_.)*(x_)]^(m_.)*((a_.) + (b_.)*sin[(d_.) + (e_.)*(x_)]^(n _.) + (c_.)*sin[(d_.) + (e_.)*(x_)]^(n2_.))^(p_), x_Symbol] :> Int[ExpandTr ig[sin[d + e*x]^m*(a + b*sin[d + e*x]^n + c*sin[d + e*x]^(2*n))^p, x], x] / ; FreeQ[{a, b, c, d, e}, x] && EqQ[n2, 2*n] && NeQ[b^2 - 4*a*c, 0] && Integ ersQ[m, n, p]
Time = 1.61 (sec) , antiderivative size = 252, normalized size of antiderivative = 1.00
method | result | size |
default | \(\frac {2 a \left (\frac {2 \left (-b \sqrt {-4 a c +b^{2}}-4 a c +b^{2}\right ) \arctan \left (\frac {2 a \tan \left (\frac {x}{2}\right )+b +\sqrt {-4 a c +b^{2}}}{\sqrt {4 a c -2 b^{2}-2 b \sqrt {-4 a c +b^{2}}+4 a^{2}}}\right )}{\left (8 a c -2 b^{2}\right ) \sqrt {4 a c -2 b^{2}-2 b \sqrt {-4 a c +b^{2}}+4 a^{2}}}-\frac {2 \left (b \sqrt {-4 a c +b^{2}}-4 a c +b^{2}\right ) \arctan \left (\frac {-2 a \tan \left (\frac {x}{2}\right )+\sqrt {-4 a c +b^{2}}-b}{\sqrt {4 a c -2 b^{2}+2 b \sqrt {-4 a c +b^{2}}+4 a^{2}}}\right )}{\left (8 a c -2 b^{2}\right ) \sqrt {4 a c -2 b^{2}+2 b \sqrt {-4 a c +b^{2}}+4 a^{2}}}\right )}{c}+\frac {2 \arctan \left (\tan \left (\frac {x}{2}\right )\right )}{c}\) | \(252\) |
risch | \(\text {Expression too large to display}\) | \(1212\) |
2/c*a*(2*(-b*(-4*a*c+b^2)^(1/2)-4*a*c+b^2)/(8*a*c-2*b^2)/(4*a*c-2*b^2-2*b* (-4*a*c+b^2)^(1/2)+4*a^2)^(1/2)*arctan((2*a*tan(1/2*x)+b+(-4*a*c+b^2)^(1/2 ))/(4*a*c-2*b^2-2*b*(-4*a*c+b^2)^(1/2)+4*a^2)^(1/2))-2*(b*(-4*a*c+b^2)^(1/ 2)-4*a*c+b^2)/(8*a*c-2*b^2)/(4*a*c-2*b^2+2*b*(-4*a*c+b^2)^(1/2)+4*a^2)^(1/ 2)*arctan((-2*a*tan(1/2*x)+(-4*a*c+b^2)^(1/2)-b)/(4*a*c-2*b^2+2*b*(-4*a*c+ b^2)^(1/2)+4*a^2)^(1/2)))+2/c*arctan(tan(1/2*x))
Leaf count of result is larger than twice the leaf count of optimal. 4985 vs. \(2 (219) = 438\).
Time = 0.98 (sec) , antiderivative size = 4985, normalized size of antiderivative = 19.70 \[ \int \frac {\sin ^2(x)}{a+b \sin (x)+c \sin ^2(x)} \, dx=\text {Too large to display} \]
1/4*(sqrt(2)*c*sqrt((a^2*b^2 - b^4 - 2*a^2*c^2 - 2*(a^3 - 2*a*b^2)*c + (4* a*c^5 + (8*a^2 - b^2)*c^4 + 2*(2*a^3 - 3*a*b^2)*c^3 - (a^2*b^2 - b^4)*c^2) *sqrt(-(a^4*b^2 - 2*a^2*b^4 + b^6 + 4*a^2*b^2*c^2 + 4*(a^3*b^2 - a*b^4)*c) /(4*a*c^9 + (16*a^2 - b^2)*c^8 + 12*(2*a^3 - a*b^2)*c^7 + 2*(8*a^4 - 11*a^ 2*b^2 + b^4)*c^6 + 4*(a^5 - 3*a^3*b^2 + 2*a*b^4)*c^5 - (a^4*b^2 - 2*a^2*b^ 4 + b^6)*c^4)))/(4*a*c^5 + (8*a^2 - b^2)*c^4 + 2*(2*a^3 - 3*a*b^2)*c^3 - ( a^2*b^2 - b^4)*c^2))*log(8*a^3*b*c^2 + 2*(4*a^3*c^5 + (8*a^4 - a^2*b^2)*c^ 4 + 2*(2*a^5 - 3*a^3*b^2)*c^3 - (a^4*b^2 - a^2*b^4)*c^2)*sqrt(-(a^4*b^2 - 2*a^2*b^4 + b^6 + 4*a^2*b^2*c^2 + 4*(a^3*b^2 - a*b^4)*c)/(4*a*c^9 + (16*a^ 2 - b^2)*c^8 + 12*(2*a^3 - a*b^2)*c^7 + 2*(8*a^4 - 11*a^2*b^2 + b^4)*c^6 + 4*(a^5 - 3*a^3*b^2 + 2*a*b^4)*c^5 - (a^4*b^2 - 2*a^2*b^4 + b^6)*c^4))*sin (x) + 4*(a^4*b - a^2*b^3)*c - sqrt(2)*((8*a^2*c^7 + 6*(4*a^3 - a*b^2)*c^6 + (24*a^4 - 22*a^2*b^2 + b^4)*c^5 + 2*(4*a^5 - 9*a^3*b^2 + 4*a*b^4)*c^4 - (2*a^4*b^2 - 3*a^2*b^4 + b^6)*c^3)*sqrt(-(a^4*b^2 - 2*a^2*b^4 + b^6 + 4*a^ 2*b^2*c^2 + 4*(a^3*b^2 - a*b^4)*c)/(4*a*c^9 + (16*a^2 - b^2)*c^8 + 12*(2*a ^3 - a*b^2)*c^7 + 2*(8*a^4 - 11*a^2*b^2 + b^4)*c^6 + 4*(a^5 - 3*a^3*b^2 + 2*a*b^4)*c^5 - (a^4*b^2 - 2*a^2*b^4 + b^6)*c^4))*cos(x) - (8*a^2*b^2*c^3 + 2*(2*a^3*b^2 - 3*a*b^4)*c^2 - (a^2*b^4 - b^6)*c)*cos(x))*sqrt((a^2*b^2 - b^4 - 2*a^2*c^2 - 2*(a^3 - 2*a*b^2)*c + (4*a*c^5 + (8*a^2 - b^2)*c^4 + 2*( 2*a^3 - 3*a*b^2)*c^3 - (a^2*b^2 - b^4)*c^2)*sqrt(-(a^4*b^2 - 2*a^2*b^4 ...
Timed out. \[ \int \frac {\sin ^2(x)}{a+b \sin (x)+c \sin ^2(x)} \, dx=\text {Timed out} \]
\[ \int \frac {\sin ^2(x)}{a+b \sin (x)+c \sin ^2(x)} \, dx=\int { \frac {\sin \left (x\right )^{2}}{c \sin \left (x\right )^{2} + b \sin \left (x\right ) + a} \,d x } \]
-(c*integrate(2*(2*b^2*cos(3*x)^2 + 2*b^2*cos(x)^2 + 2*b^2*sin(3*x)^2 + 2* b^2*sin(x)^2 + 4*(2*a^2 + a*c)*cos(2*x)^2 + 2*(4*a*b + b*c)*cos(x)*sin(2*x ) + 4*(2*a^2 + a*c)*sin(2*x)^2 + b*c*sin(x) - (2*a*c*cos(2*x) + b*c*sin(3* x) - b*c*sin(x))*cos(4*x) - 2*(2*b^2*cos(x) + (4*a*b + b*c)*sin(2*x))*cos( 3*x) - 2*(a*c + (4*a*b + b*c)*sin(x))*cos(2*x) + (b*c*cos(3*x) - b*c*cos(x ) - 2*a*c*sin(2*x))*sin(4*x) - (4*b^2*sin(x) + b*c - 2*(4*a*b + b*c)*cos(2 *x))*sin(3*x))/(c^3*cos(4*x)^2 + 4*b^2*c*cos(3*x)^2 + 4*b^2*c*cos(x)^2 + c ^3*sin(4*x)^2 + 4*b^2*c*sin(3*x)^2 + 4*b^2*c*sin(x)^2 + 4*b*c^2*sin(x) + c ^3 + 4*(4*a^2*c + 4*a*c^2 + c^3)*cos(2*x)^2 + 8*(2*a*b*c + b*c^2)*cos(x)*s in(2*x) + 4*(4*a^2*c + 4*a*c^2 + c^3)*sin(2*x)^2 - 2*(2*b*c^2*sin(3*x) - 2 *b*c^2*sin(x) - c^3 + 2*(2*a*c^2 + c^3)*cos(2*x))*cos(4*x) - 8*(b^2*c*cos( x) + (2*a*b*c + b*c^2)*sin(2*x))*cos(3*x) - 4*(2*a*c^2 + c^3 + 2*(2*a*b*c + b*c^2)*sin(x))*cos(2*x) + 4*(b*c^2*cos(3*x) - b*c^2*cos(x) - (2*a*c^2 + c^3)*sin(2*x))*sin(4*x) - 4*(2*b^2*c*sin(x) + b*c^2 - 2*(2*a*b*c + b*c^2)* cos(2*x))*sin(3*x)), x) - x)/c
Timed out. \[ \int \frac {\sin ^2(x)}{a+b \sin (x)+c \sin ^2(x)} \, dx=\text {Timed out} \]
Time = 28.23 (sec) , antiderivative size = 15461, normalized size of antiderivative = 61.11 \[ \int \frac {\sin ^2(x)}{a+b \sin (x)+c \sin ^2(x)} \, dx=\text {Too large to display} \]
(2*atan((147456*a^5*tan(x/2))/(16384*a*b^4 + 393216*a^4*c + 147456*a^5 - 2 29376*a^3*b^2 + 262144*a^3*c^2 - 131072*a^2*b^2*c + (32768*a^2*b^4)/c - (3 2768*a^4*b^2)/c) + (393216*a^4*tan(x/2))/(262144*a^3*c + 393216*a^4 - 1310 72*a^2*b^2 + (147456*a^5)/c + (16384*a*b^4)/c - (229376*a^3*b^2)/c + (3276 8*a^2*b^4)/c^2 - (32768*a^4*b^2)/c^2) + (16384*a*b^4*tan(x/2))/(16384*a*b^ 4 + 393216*a^4*c + 147456*a^5 - 229376*a^3*b^2 + 262144*a^3*c^2 - 131072*a ^2*b^2*c + (32768*a^2*b^4)/c - (32768*a^4*b^2)/c) + (262144*a^3*c*tan(x/2) )/(262144*a^3*c + 393216*a^4 - 131072*a^2*b^2 + (147456*a^5)/c + (16384*a* b^4)/c - (229376*a^3*b^2)/c + (32768*a^2*b^4)/c^2 - (32768*a^4*b^2)/c^2) - (229376*a^3*b^2*tan(x/2))/(16384*a*b^4 + 393216*a^4*c + 147456*a^5 - 2293 76*a^3*b^2 + 262144*a^3*c^2 - 131072*a^2*b^2*c + (32768*a^2*b^4)/c - (3276 8*a^4*b^2)/c) - (131072*a^2*b^2*tan(x/2))/(262144*a^3*c + 393216*a^4 - 131 072*a^2*b^2 + (147456*a^5)/c + (16384*a*b^4)/c - (229376*a^3*b^2)/c + (327 68*a^2*b^4)/c^2 - (32768*a^4*b^2)/c^2) + (32768*a^2*b^4*tan(x/2))/(147456* a^5*c + 32768*a^2*b^4 - 32768*a^4*b^2 + 262144*a^3*c^3 + 393216*a^4*c^2 - 229376*a^3*b^2*c - 131072*a^2*b^2*c^2 + 16384*a*b^4*c) - (32768*a^4*b^2*ta n(x/2))/(147456*a^5*c + 32768*a^2*b^4 - 32768*a^4*b^2 + 262144*a^3*c^3 + 3 93216*a^4*c^2 - 229376*a^3*b^2*c - 131072*a^2*b^2*c^2 + 16384*a*b^4*c)))/c - atan((((b^6 - a^2*b^4 - 8*a^3*c^3 - 8*a^4*c^2 - b^3*(-(4*a*c - b^2)^3)^ (1/2) + a^2*b*(-(4*a*c - b^2)^3)^(1/2) + 6*a^3*b^2*c + 18*a^2*b^2*c^2 -...